/*
 * This file is a part of the SWFer project.
 *
 * Copyright (C) 2012 Michael Bradshaw <mjbshaw@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef TAGCODES_HPP
#define TAGCODES_HPP

#include "BasicBaseTypes.hpp"

namespace swfer
{

enum TagCode
{
    END = 0,
    SHOW_FRAME = 1,
    DEFINE_SHAPE = 2,
    PLACE_OBJECT = 4,
    REMOVE_OBJECT = 5,
    DEFINE_BITS = 6,
    DEFINE_BUTTON = 7,
    JPEG_TABLES = 8,
    SET_BACKGROUND_COLOR = 9,
    DEFINE_FONT = 10,
    DEFINE_TEXT = 11,
    DO_ACTION = 12,
    DEFINE_FONT_INFO = 13,
    DEFINE_SOUND = 14,
    START_SOUND = 15,
    DEFINE_BUTTON_SOUND = 17,
    SOUND_STREAM_HEAD = 18,
    SOUND_STREAM_BLOCK = 19,
    DEFINE_BITS_LOSSLESS = 20,
    DEFINE_BITS_JPEG2 = 21,
    DEFINE_SHAPE2 = 22,
    DEFINE_BUTTON_CXFORM = 23,
    PROTECT = 24,
    PLACE_OBJECT2 = 26,
    REMOVE_OBJECT2 = 28,
    DEFINE_SHAPE3 = 32,
    DEFINE_TEXT2 = 33,
    DEFINE_BUTTON2 = 34,
    DEFINE_BITS_JPEG3 = 35,
    DEFINE_BITS_LOSSLESS2 = 36,
    DEFINE_EDIT_TEXT = 37,
    DEFINE_SPRITE = 39,
    FRAME_LABEL = 43,
    SOUND_STREAM_HEAD2 = 45,
    DEFINE_MORPH_SHAPE = 46,
    DEFINE_FONT2 = 48,
    EXPORT_ASSETS = 56,
    IMPORT_ASSETS = 57,
    ENABLE_DEBUGGER = 58,
    DO_INIT_ACTION = 59,
    DEFINE_VIDEO_STREAM = 60,
    VIDEO_FRAME = 61,
    DEFINE_FONT_INFO2 = 62,
    ENABLE_DEBUGGER2 = 64,
    SCRIPT_LIMITS = 65,
    SET_TAB_INDEX = 66,
    FILE_ATTRIBUTES = 69,
    PLACE_OBJECT3 = 70,
    IMPORT_ASSETS2 = 71,
    DEFINE_FONT_ALIGN_ZONES = 73,
    CSM_TEXT_SETTINGS = 74,
    DEFINE_FONT3 = 75,
    SYMBOL_CLASS = 76,
    METADATA = 77,
    DEFINE_SCALING_GRID = 78,
    DO_ABC = 82,
    DEFINE_SHAPE4 = 83,
    DEFINE_MORPH_SHAPE2 = 84,
    DEFINE_SCENE_AND_FRAME_LABEL_DATA = 86,
    DEFINE_BINARY_DATA = 87,
    DEFINE_FONT_NAME = 88,
    START_SOUND2 = 89,
    DEFINE_BITS_JPEG4 = 90,
    DEFINE_FONT4 = 91,

    UNKNOWN = 0x03ff
};

// TODO: put in source file
static const char* tagCodeToString(uint16_t code)
{
    if (code > 0x03ff) return "!INVALID!";

    switch (code)
    {
    case END: return "END";
    case SHOW_FRAME: return "SHOW_FRAME";
    case DEFINE_SHAPE: return "DEFINE_SHAPE";
    case PLACE_OBJECT: return "PLACE_OBJECT";
    case REMOVE_OBJECT: return "REMOVE_OBJECT";
    case DEFINE_BITS: return "DEFINE_BITS";
    case DEFINE_BUTTON: return "DEFINE_BUTTON";
    case JPEG_TABLES: return "JPEG_TABLES";
    case SET_BACKGROUND_COLOR: return "SET_BACKGROUND_COLOR";
    case DEFINE_FONT: return "DEFINE_FONT";
    case DEFINE_TEXT: return "DEFINE_TEXT";
    case DO_ACTION: return "DO_ACTION";
    case DEFINE_FONT_INFO: return "DEFINE_FONT_INFO";
    case DEFINE_SOUND: return "DEFINE_SOUND";
    case START_SOUND: return "START_SOUND";
    case DEFINE_BUTTON_SOUND: return "DEFINE_BUTTON_SOUND";
    case SOUND_STREAM_HEAD: return "SOUND_STREAM_HEAD";
    case SOUND_STREAM_BLOCK: return "SOUND_STREAM_BLOCK";
    case DEFINE_BITS_LOSSLESS: return "DEFINE_BITS_LOSSLESS";
    case DEFINE_BITS_JPEG2: return "DEFINE_BITS_JPEG2";
    case DEFINE_SHAPE2: return "DEFINE_SHAPE2";
    case DEFINE_BUTTON_CXFORM: return "DEFINE_BUTTON_CXFORM";
    case PROTECT: return "PROTECT";
    case PLACE_OBJECT2: return "PLACE_OBJECT2";
    case REMOVE_OBJECT2: return "REMOVE_OBJECT2";
    case DEFINE_SHAPE3: return "DEFINE_SHAPE3";
    case DEFINE_TEXT2: return "DEFINE_TEXT2";
    case DEFINE_BUTTON2: return "DEFINE_BUTTON2";
    case DEFINE_BITS_JPEG3: return "DEFINE_BITS_JPEG3";
    case DEFINE_BITS_LOSSLESS2: return "DEFINE_BITS_LOSSLESS2";
    case DEFINE_EDIT_TEXT: return "DEFINE_EDIT_TEXT";
    case DEFINE_SPRITE: return "DEFINE_SPRITE";
    case FRAME_LABEL: return "FRAME_LABEL";
    case SOUND_STREAM_HEAD2: return "SOUND_STREAM_HEAD2";
    case DEFINE_MORPH_SHAPE: return "DEFINE_MORPH_SHAPE";
    case DEFINE_FONT2: return "DEFINE_FONT2";
    case EXPORT_ASSETS: return "EXPORT_ASSETS";
    case IMPORT_ASSETS: return "IMPORT_ASSETS";
    case ENABLE_DEBUGGER: return "ENABLE_DEBUGGER";
    case DO_INIT_ACTION: return "DO_INIT_ACTION";
    case DEFINE_VIDEO_STREAM: return "DEFINE_VIDEO_STREAM";
    case VIDEO_FRAME: return "VIDEO_FRAME";
    case DEFINE_FONT_INFO2: return "DEFINE_FONT_INFO2";
    case ENABLE_DEBUGGER2: return "ENABLE_DEBUGGER2";
    case SCRIPT_LIMITS: return "SCRIPT_LIMITS";
    case SET_TAB_INDEX: return "SET_TAB_INDEX";
    case FILE_ATTRIBUTES: return "FILE_ATTRIBUTES";
    case PLACE_OBJECT3: return "PLACE_OBJECT3";
    case IMPORT_ASSETS2: return "IMPORT_ASSETS2";
    case DEFINE_FONT_ALIGN_ZONES: return "DEFINE_FONT_ALIGN_ZONES";
    case CSM_TEXT_SETTINGS: return "CSM_TEXT_SETTINGS";
    case DEFINE_FONT3: return "DEFINE_FONT3";
    case SYMBOL_CLASS: return "SYMBOL_CLASS";
    case METADATA: return "METADATA";
    case DEFINE_SCALING_GRID: return "DEFINE_SCALING_GRID";
    case DO_ABC: return "DO_ABC";
    case DEFINE_SHAPE4: return "DEFINE_SHAPE4";
    case DEFINE_MORPH_SHAPE2: return "DEFINE_MORPH_SHAPE2";
    case DEFINE_SCENE_AND_FRAME_LABEL_DATA: return "DEFINE_SCENE_AND_FRAME_LABEL_DATA";
    case DEFINE_BINARY_DATA: return "DEFINE_BINARY_DATA";
    case DEFINE_FONT_NAME: return "DEFINE_FONT_NAME";
    case START_SOUND2: return "START_SOUND2";
    case DEFINE_BITS_JPEG4: return "DEFINE_BITS_JPEG4";
    case DEFINE_FONT4: return "DEFINE_FONT4";
    default: return "???";
    }
}

}

#endif
